home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Dialogs.h < prev    next >
Text File  |  1991-04-17  |  5KB  |  185 lines

  1. /************************************************************
  2.  
  3. Created: Tuesday, January 8, 1991 at 1:03 PM
  4.     Dialogs.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.     1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __DIALOGS__
  15. #define __DIALOGS__
  16.  
  17. #ifndef __WINDOWS__
  18. #include <Windows.h>
  19. #endif
  20.  
  21. #ifndef __TEXTEDIT__
  22. #include <TextEdit.h>
  23. #endif
  24.  
  25.  
  26. enum {
  27.  
  28.     ctrlItem = 4,
  29.     btnCtrl = 0,
  30.     chkCtrl = 1,
  31.     radCtrl = 2,
  32.     resCtrl = 3,
  33.     statText = 8,
  34.     editText = 16,
  35.     iconItem = 32,
  36.     picItem = 64,
  37.     userItem = 0,
  38.     itemDisable = 128,
  39.     ok = 1,
  40.     cancel = 2,
  41.     stopIcon = 0,
  42.     noteIcon = 1,
  43.     cautionIcon = 2
  44. };
  45.  
  46. typedef short StageList;
  47. typedef WindowPtr DialogPtr;
  48. typedef pascal void (*ResumeProcPtr)(void);
  49. typedef pascal void (*SoundProcPtr)(void);
  50. typedef pascal Boolean (*ModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
  51.  
  52. struct DialogRecord {
  53.     WindowRecord window;
  54.     Handle items;
  55.     TEHandle textH;
  56.     short editField;
  57.     short editOpen;
  58.     short aDefItem;
  59. };
  60.  
  61. typedef struct DialogRecord DialogRecord;
  62. typedef DialogRecord *DialogPeek;
  63.  
  64. struct DialogTemplate {
  65.     Rect boundsRect;
  66.     short procID;
  67.     Boolean visible;
  68.     Boolean filler1;
  69.     Boolean goAwayFlag;
  70.     Boolean filler2;
  71.     long refCon;
  72.     short itemsID;
  73.     Str255 title;
  74. };
  75.  
  76. typedef struct DialogTemplate DialogTemplate;
  77. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  78.  
  79. struct AlertTemplate {
  80.     Rect boundsRect;
  81.     short itemsID;
  82.     StageList stages;
  83. };
  84.  
  85. typedef struct AlertTemplate AlertTemplate;
  86. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  87.  
  88.  
  89. #ifdef __cplusplus
  90. extern "C" {
  91. #endif
  92. pascal void InitDialogs(ResumeProcPtr resumeProc)
  93.     = 0xA97B; 
  94. pascal void ErrorSound(SoundProcPtr soundProc)
  95.     = 0xA98C; 
  96. pascal DialogPtr NewDialog(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  97.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  98.     Handle itmLstHndl)
  99.     = 0xA97D; 
  100. DialogPtr newdialog(void *wStorage,const Rect *boundsRect,char *title,Boolean visible,
  101.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle itmLstHndl); 
  102. pascal DialogPtr GetNewDialog(short dialogID,void *dStorage,WindowPtr behind)
  103.     = 0xA97C; 
  104. pascal void CloseDialog(DialogPtr theDialog)
  105.     = 0xA982; 
  106. pascal void DisposDialog(DialogPtr theDialog)
  107.     = 0xA983; 
  108. pascal void DisposeDialog(DialogPtr theDialog)
  109.     = 0xA983; 
  110. pascal void CouldDialog(short dialogID)
  111.     = 0xA979; 
  112. pascal void FreeDialog(short dialogID)
  113.     = 0xA97A; 
  114. pascal void ParamText(ConstStr255Param param0,ConstStr255Param param1,ConstStr255Param param2,
  115.     ConstStr255Param param3)
  116.     = 0xA98B; 
  117. pascal void ModalDialog(ModalFilterProcPtr filterProc,short *itemHit)
  118.     = 0xA991; 
  119. pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  120.     = 0xA97F; 
  121. pascal Boolean DialogSelect(const EventRecord *theEvent,DialogPtr *theDialog,
  122.     short *itemHit)
  123.     = 0xA980; 
  124. pascal void DrawDialog(DialogPtr theDialog)
  125.     = 0xA981; 
  126. pascal void UpdtDialog(DialogPtr theDialog,RgnHandle updateRgn)
  127.     = 0xA978; 
  128. pascal void UpdateDialog(DialogPtr theDialog,RgnHandle updateRgn)
  129.     = 0xA978; 
  130. pascal short Alert(short alertID,ModalFilterProcPtr filterProc)
  131.     = 0xA985; 
  132. pascal short StopAlert(short alertID,ModalFilterProcPtr filterProc)
  133.     = 0xA986; 
  134. pascal short NoteAlert(short alertID,ModalFilterProcPtr filterProc)
  135.     = 0xA987; 
  136. pascal short CautionAlert(short alertID,ModalFilterProcPtr filterProc)
  137.     = 0xA988; 
  138. pascal void CouldAlert(short alertID)
  139.     = 0xA989; 
  140. pascal void FreeAlert(short alertID)
  141.     = 0xA98A; 
  142. pascal void GetDItem(DialogPtr theDialog,short itemNo,short *itemType,Handle *item,
  143.     Rect *box)
  144.     = 0xA98D; 
  145. pascal void SetDItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  146.     const Rect *box)
  147.     = 0xA98E; 
  148. pascal void HideDItem(DialogPtr theDialog,short itemNo)
  149.     = 0xA827; 
  150. pascal void ShowDItem(DialogPtr theDialog,short itemNo)
  151.     = 0xA828; 
  152. pascal void SelIText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  153.     = 0xA97E; 
  154. pascal void GetIText(Handle item,Str255 text)
  155.     = 0xA990; 
  156. pascal void SetIText(Handle item,ConstStr255Param text)
  157.     = 0xA98F; 
  158. pascal short FindDItem(DialogPtr theDialog,Point thePt)
  159.     = 0xA984; 
  160. pascal DialogPtr NewCDialog(void *dStorage,const Rect *boundsRect,ConstStr255Param title,
  161.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  162.     Handle items)
  163.     = 0xAA4B; 
  164. DialogPtr newcdialog(void *dStorage,const Rect *boundsRect,char *title,
  165.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  166.     Handle items); 
  167. #define GetAlrtStage() (* (short*) 0x0A9A)
  168. pascal void ResetAlrtStage(void)
  169.     = {0x4278,0x0A9A}; 
  170. pascal void DlgCut(DialogPtr theDialog); 
  171. pascal void DlgPaste(DialogPtr theDialog); 
  172. pascal void DlgCopy(DialogPtr theDialog); 
  173. pascal void DlgDelete(DialogPtr theDialog); 
  174. pascal void SetDAFont(short fontNum)
  175.     = {0x31DF,0x0AFA}; 
  176. void paramtext(char *param0,char *param1,char *param2,char *param3); 
  177. void getitext(Handle item,char *text); 
  178. void setitext(Handle item,char *text); 
  179. short findditem(DialogPtr theDialog,Point *thePt); 
  180. #ifdef __cplusplus
  181. }
  182. #endif
  183.  
  184. #endif
  185.